package utils
{
	import flash.display.Graphics;
	import flash.geom.Point;

	public class DrawUtils
	{
		public function DrawUtils()
		{
		}
		public static function drawDashed(graphics:Graphics,p1:Point,p2:Point,length:Number=5,gap:Number=5):void  
		{   
			var max:Number = Point.distance(p1,p2);   
			var l:Number = 0;   
			var p3:Point;   
			var p4:Point;   
			while(l<max)   
			{   
				p3 = Point.interpolate(p2,p1,l/max);   
				l+=length;   
				if(l>max)l=max   
				p4 = Point.interpolate(p2,p1,l/max);   
				graphics.moveTo(p3.x,p3.y)   
				graphics.lineTo(p4.x,p4.y)   
				l+=gap;   
			}   
		} 
	}
}